package com.sunsheng.common.utils;

import com.alibaba.druid.util.StringUtils;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

/**
 * 判空示例
 */
public class isEmpty {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
//        System.out.println("CollectionUtils=======>" + CollectionUtils.isEmpty(list));
//        System.out.println("StringUtils=======>" + StringUtils.isEmpty(""));
//        System.out.println("ObjectUtils=======>" + ObjectUtils.isEmpty(list));
//        Optional<String> optionalS = Optional.ofNullable("");
//        System.out.println("optional=======>" + optionalS.orElse(""));
    }
}
